package com.etone.smartAudit.dto.DataMetaTask;

import com.etone.smartAudit.dto.FileDTO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.List;

/**
 * @author: sovy
 * @date: 2020/11/23
 * @description: 数据模型导入表单
 */

@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(value = "DataMetaTaskDTO", description = "数据模型导入表单")
public class DataMetaTaskDTO implements Serializable {

    @ApiModelProperty("数据模型id")
    @NotNull
    private Integer dataModeId;

    @ApiModelProperty("任务名称")
    @NotNull
    private String taskName;

    @ApiModelProperty("记录分隔符，默认填(CRLF)")
    @NotNull
    private String rowSeparator;

    @ApiModelProperty("内容分隔符，默认填英文逗号")
    @NotNull
    private String columnSeparator;

    @ApiModelProperty("文件名称")
    @NotNull
    private FileDTO file;

    @ApiModelProperty("表头所在行，默认填：1")
    @NotNull
    private Integer headerRow;

    @ApiModelProperty("第一行数据，默认填：2")
    @NotNull
    private Integer firstRow;

    @ApiModelProperty("最后一行数据")
    private Integer lastRow;

    @ApiModelProperty("日期格式")
    private String dateFormat;

    @ApiModelProperty("日期分隔符")
    private String dateSeparator;

    @ApiModelProperty("时间分隔符")
    private String timeSeparator;

    @ApiModelProperty("日期时间排序")
    private String dataTimeSort;

    @ApiModelProperty("字段信息")
    @NotNull
    private List<DataMetaFieldInfoDTO> fieldInfo;

    @ApiModelProperty("数据库导入模式，ADD追加，COVER覆盖")
    @NotNull
    private String importMode;

    @ApiModelProperty("是否自动入库")
    @NotNull
    private Boolean isAuto;

}
